import React, {Component} from 'react'
import {FormGroupLabel} from './FormGroupLabel'

interface Props {
  valid?: boolean
  className?: string
}

class FormFeedback extends Component<Props> {
  render() {
    let {valid, className} = this.props
    return (
      <FormGroupLabel className={className}>
        <span
          className={'form-feedback ' + (valid ? 'form-feedback-valid' : 'form-feedback-invalid')}>
          {this.props.children}
        </span>
      </FormGroupLabel>
    )
  }
}

export default FormFeedback
